package com.spring.IoCStudy_05;

/*
制造JavaBean的工厂类
 */

/*
步骤：

 */

import org.springframework.beans.factory.FactoryBean;

public class JavaBeanFactoryBean implements FactoryBean<JavaBean> {

    private String name;

    public void setName(String name) {
        this.name = name;
    }
    @Override
    public JavaBean getObject() throws Exception {
        // 使用你自己的方式实例化对象即可
        JavaBean javaBean = new JavaBean();
        javaBean.setName(name);
        return javaBean;
    }

    @Override
    public Class<?> getObjectType() {
        return JavaBean.class;
    }


}
